package com.mayikt.jwt;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Base64;

/**
 * @ClassName JwtTest
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class JwtTest {
    // 签名key 秘钥 盐值
    private static String SIGN_KEY = "mayiktSignKey";

    /**
     *
     *
     * @param args
     */

    public static void main(String[] args) {
        // 创建jwt
        JwtBuilder jwtBuilder = Jwts.builder()
                // 存放peyload中的数据
                .claim("phone", "1592*****100")

                // 设置签名值
                .signWith(SignatureAlgorithm.HS256, SIGN_KEY);

        System.out.println(jwtBuilder.compact());
    }
}
